package com.swe.chumsmobile.activities;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

import com.swe.chumsmobile.R;

public class WebResourcesActivity extends TabActivity {

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.web_resources);

		TabHost tabHost = getTabHost();

		// HttpClient httpClient = new DefaultHttpClient();
		// HttpContext localContext = new BasicHttpContext();
		// HttpGet httpGet = new HttpGet("http://www.example.com/" + URL);
		// HttpResponse response = httpClient.execute(httpGet, localContext);

		// Tab for Top Courses
		TabSpec topCourses = tabHost.newTabSpec("TopCourses");
		// setting Title and Icon for the Tab
		topCourses.setIndicator("Top Courses",
				getResources().getDrawable(R.drawable.icon_top_courses_tab));
		Intent topCoursesIntent = new Intent(this, TopCoursesActivity.class);
		topCourses.setContent(topCoursesIntent);

		// Tab for Top Instructors
		TabSpec topInstructors = tabHost.newTabSpec("TopInstructors");
		topInstructors.setIndicator("Top Instructors", 
				getResources().getDrawable(R.drawable.icon_top_instructors_tab));
		Intent topInstructorsIntent = new Intent(this,
				TopInstructorsActivity.class);
		topInstructors.setContent(topInstructorsIntent);

		// Tab for Top Institutions
		TabSpec topInstitutions = tabHost.newTabSpec("TopInstitutions");
		topInstitutions.setIndicator("Top Institutions", 
				getResources().getDrawable(R.drawable.icon_top_institutions_tab));
		Intent topInstitutionsIntent = new Intent(this,
				TopInstitutionsActivity.class);
		topInstitutions.setContent(topInstitutionsIntent);

		// Adding all TabSpec to TabHost
		tabHost.addTab(topCourses);
		tabHost.addTab(topInstructors);
		tabHost.addTab(topInstitutions);
	}
}
